package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.mall.lib.domain.enumclass.ArticleCategoryType;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Created by anti on 2016-08-22.
 */
@Entity
@Table(name = "article_category")
@DynamicInsert
@DynamicUpdate
public class ArticleCategory extends IDEntityMall {

    @Column(columnDefinition = "varchar(100) comment '名称'")
    private String name;

    @Column(columnDefinition = "int comment '显示顺序'")
    private Integer displayOrderId;

    @Column(columnDefinition = "bigint comment '平台id'")
    private Long mallId;

    @Column(columnDefinition = "bigint comment '父分类Id'")
    private Long parentId;

    @Column(columnDefinition = "varchar(30) comment '文章分类类型( BUSINESS_HELP_CENTER(\"商家帮助中心\"), PLATFORM_HELP_CENTERL(\"商城帮助中心\"), OTHER(\"其它\") )'")
    @Enumerated(EnumType.STRING)
    private ArticleCategoryType type = ArticleCategoryType.OTHER;

    public static final String ATTR_THIS = "article_category";

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getDisplayOrderId() {
        return displayOrderId;
    }

    public void setDisplayOrderId(Integer displayOrderId) {
        this.displayOrderId = displayOrderId;
    }

    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public ArticleCategoryType getType() {
        return type;
    }

    public void setType(ArticleCategoryType type) {
        this.type = type;
    }

    @Override
    public String toString() {
        return "ArticleCategory{" +
                "name='" + name + '\'' +
                ", displayOrderId=" + displayOrderId +
                ", mallId=" + mallId +
                ", parentId=" + parentId +
                ", type=" + type +
                '}';
    }
}
